package com.besttone.widget;

import com.besttone.search.R;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

public class PoiListItem extends LinearLayout
{

	TextView name;
	TextView tel;
	TextView addr;

	public PoiListItem(Context context) {
		super(context);
	}

	public PoiListItem(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public void setPoiData(String name, String tel, String addr, String city) {
		
		int m = 0;
		
		if(city!=null && city.trim().length()!=0){
			this.addr.setText("【" + city +"】" + addr);
		} else {
			this.addr.setText(addr);
		}
		this.tel.setText(tel);
		this.name.setText(name);

		this.name.setPadding(this.name.getPaddingLeft(), this.name.getPaddingTop(), m, this.name.getPaddingBottom());
	}
	
	protected void onFinishInflate() {
		super.onFinishInflate();
		this.name = ((TextView) findViewById(R.id.name));
		this.tel = ((TextView) findViewById(R.id.tel));
		this.addr = ((TextView) findViewById(R.id.addr));
	}
	
}